<script lang="ts" setup>
import hospitalMain from "./components/hospitalMain.vue";
import { onMounted, ref, onBeforeMount } from "vue";
import designer from "./components/designer.vue";
import indication from "./components/indication.vue";
import Publicitytest from "./components/Publicitytest.vue";
const tableData = [
  {
    date: "2016-05-03",
    name: "Tom",
    state: "California",
    city: "Los Angeles",
    address: "No. 189, Grove St, Los Angeles",
    zip: "CA 90036",
  },
];
const input2 = ref("");
const currentPage2 = ref(5);
const pageSize2 = ref(100);
const size = ref(10);
const background = ref(false);

const handleSizeChange = (val: number) => {
  console.log(`${val} items per page`);
};
const handleCurrentChange = (val: number) => {
  console.log(`current page: ${val}`);
};
const active = ref(0);
const changeAct = (val: any) => {
  active.value = val;
};
const testAct = ref("0");
const changeTest = (val: any) => {
  testAct.value = val;
};
const actList = ref(["主页", "概况", "研究者", "适应症", "公示试验"]);
</script>
<template>
  <div class="container1 container" style="padding: 0">
    <div class="userbox">
      <div class="user_l">
        <img src="" class="useravatar" alt="" />
        <div>
          <div style="display: flex; align-items: flex-end">
            <p>赵彦秋</p>
          </div>
          <div class="tag">三甲</div>
          <span>河南省肿瘤医院</span>
        </div>
      </div>
      <div class="user_r">
        非小细胞肺癌、实体瘤、小细胞肺癌、肿瘤、肺癌、间皮瘤、骨转移、骨肉瘤
      </div>
      <ul>
        <li
          v-for="(i, n) in actList"
          :class="active == n ? 'on' : ''"
          @click="changeAct(n)"
        >
          {{ i }}
        </li>
      </ul>
    </div>
    <!-- 主页 -->
    <template v-if="active == 0">
      <div class="contentbox">
        <div class="searchHeader">
          <div>最新试验（88）</div>
          <div style="display: flex; align-items: center; color: #888888">
            全部
            <el-icon>
              <ArrowRight />
            </el-icon>
          </div>
        </div>
        <el-table
          class="testTable"
          :data="tableData"
          align="left"
          header-row-class-name="headerName"
          :border="false"
          style="width: 100%"
        >
          <el-table-column type="expand">
            <template #default="props">
              <div class="expandData">
                <p>登记号:CTR20244572</p>
                <p>试验分类:药代动力学/药效动力学试验</p>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="date" label="试验名称" width="300">
            <template #default="scope">
              <p style="color: #0c9397">试验分类:药代动力学/药效动力学试验</p>
            </template>
          </el-table-column>
          <el-table-column prop="date" label="适应症" />
          <el-table-column prop="date" label="本院研究者" />

          <el-table-column prop="date" label="申办方" />

          <el-table-column prop="date" label="分期" width="180">
            <template #default="scope">
              <!-- <el-button size="mini" style="color: #0C9397;" link> 合作咨询 </el-button> -->
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="moduleTitle">
        <div>主要研究者(71)</div>
        <div style="display: flex; align-items: center; color: #888888">
          全部
          <el-icon>
            <ArrowRight />
          </el-icon>
        </div>
      </div>
      <div class="justify-between">
        <div v-for="i in 2" class="mainPeople">
          <div class="infobox">
            <img src="" class="" alt="" />
            <div>
              <div>
                <p>赵彦秋</p>
              </div>
              <span>主任医师</span>
            </div>
            <span class="onlineData">在研项目 171</span>
          </div>
          <div class="forte">
            <img src="@/assets/images/ys.png" alt="" />
            非小细胞肺癌、实体瘤、小细胞肺癌、肿瘤、肺癌、间皮瘤、骨转移、骨肉瘤
          </div>
        </div>
      </div>
      <div class="moduleTitle">
        <div>适应症 <span>(22)</span></div>
        <div style="display: flex; align-items: center; color: #888888">
          全部
          <el-icon>
            <ArrowRight />
          </el-icon>
        </div>
      </div>
      <div class="justify-between">
        <div v-for="i in 5" class="itembox">
          <p>非小细胞肺癌</p>
          <div class="align-center">
            <i></i> <strong>在研项目</strong> <span>241</span>
          </div>
        </div>
      </div>
    </template>
    <!-- 概况 -->
    <hospitalMain ref="hospitalMainref" v-if="active == 1"></hospitalMain>
    <!-- 研究者 -->
    <designer v-if="active == 2"></designer>
    <!-- 适应症 -->
    <indication v-if="active == 3"></indication>
    <Publicitytest v-if="active==4"></Publicitytest>
  </div>
</template>
<style scoped lang="scss">
.container {
  // background-color: #fff;
  height: calc(100% - 40px);
  margin: 20px auto;
}

button {
  width: 120px;
  height: 36px;
  background-color: #f5f5f5;
  font-size: 16px;
  margin-right: 11px;
  cursor: pointer;
  color: #333333;
}

.searchHeader {
  display: flex;
  margin-bottom: 13px;
  justify-content: space-between;
}

.moduleTitle {
  display: flex;
  margin: 24px 0 20px;
  justify-content: space-between;
}

.pagination {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
}

.openTest {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;

  button {
    margin: 0;
    border: 1px solid #0c9397;
    color: #0c9397;
    background-color: rgba(12, 147, 151, 0.1);
  }

  span {
    margin-right: 12px;
    color: #666;
  }

  .teston {
    background-color: #0c9397;
    color: #fff;
  }
}

.expandData {
  background: #f5f5f5;
  margin: 10px 20px;

  p {
    font-size: 16px;
    color: #666666;
    margin-top: 10px;
  }
}

.userbox {
  background-color: #fff;
  padding: 25px 20px;

  // height: 160px;
  .user_l {
    display: flex;
    line-height: 1;

    img {
      width: 88px;
      height: 88px;
      border-radius: 50%;
      margin-right: 15px;
    }

    font-size: 15px;
    color: #333333;

    p {
      font-size: 20px;
      color: #111111;
    }

    span {
      color: #999999;

      display: inline-block;
    }

    .tag {
      width: 44px;
      height: 22px;
      background: #0c9397;
      border-radius: 3px;
      font-size: 14px;
      color: #fff;
      text-align: center;
      line-height: 22px;
      margin: 14px 0 10px;
    }
  }

  .user_r {
    position: relative;
    border-bottom: 1px solid #ebebeb;
    border-top: 1px solid #ebebeb;
    padding: 24px 0 30px;
    margin-top: 25px;
    color: #888888;
    font-size: 16px;
  }

  ul {
    display: flex;
    align-items: center;
    margin-top: 16px;
    color: #333;

    li {
      cursor: pointer;
      margin-right: 60px;
      min-width: 64px;
    }

    .on {
      background-color: #0c9397;
      color: #fff;
      padding: 8px 15px;
      border-radius: 6px;
      font-size: 18px;
      position: relative;
    }
    .on::after{
      width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #0c9397;
position: absolute;
clear: both;
content: '';
left: 0;
right: 0;
margin: auto;
bottom: -10px;
    } 
  }
}

.contentbox {
  background-color: #fff;
  padding: 20px;
  margin-top: 20px;
}

.mainPeople {
  background-color: #fff;
  width: 630px;
  font-size: 16px;
  color: #999999;

  padding: 20px 25px 30px;

  .infobox {
    display: flex;
    align-items: center;
    position: relative;

    .onlineData {
      position: absolute;
      color: #0c9397;
      right: 0;
      top: 10px;
    }

    img {
      width: 70px;
      height: 70px;
      border-radius: 50%;
      margin-right: 16px;
    }

    p {
      font-size: 20px;
      color: #111111;
      margin-bottom: 16px;
    }
  }

  .forte {
    display: flex;
    align-items: center;
    border-top: 1px solid #ebebeb;
    padding-top: 20px;
    margin-top: 20px;

    img {
      width: 50px;
      height: 25px;
      margin-right: 16px;
    }
  }
}
.itembox {
  width: 240px;
  height: 110px;
  background: #ffffff;
  padding: 25px 28px;
  p {
    font-size: 20px;
    color: #333333;
    margin-bottom: 20px;
  }
  .align-center {
    i {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #0c9397;
      display: block;
    }
    span {
      color: #0c9397;
    }
    strong {
      margin: 0 10px;
    }
  }
}
</style>